package com.zhuozhou.jdyc.main.goods.adapter;

import android.content.Context;

import com.bumptech.glide.Glide;
import com.zhuozhou.jdyc.R;
import com.zhuozhou.jdyc.base.BaseRecyclerViewAdapter;
import com.zhuozhou.jdyc.base.BaseViewHolder;
import com.zhuozhou.jdyc.databinding.AdapterEvaluateBinding;
import com.zhuozhou.jdyc.main.goods.bean.BasicsCommentDetailsBase;
import com.zhuozhou.jdyc.main.main.adapter.BarterImageAdapter;
import com.zhuozhou.jdyc.wight.recyclerview.FullyGridLayoutManager;

/**
 * Create by Once_ChuXy on 2021/9/17
 * Describe:评价
 */
public class EvaluateAdapter extends BaseRecyclerViewAdapter<BasicsCommentDetailsBase.CommentBean, AdapterEvaluateBinding> {


    public EvaluateAdapter(Context context) {
        super(context);
    }


    @Override
    protected int getLayoutId() {
        return R.layout.adapter_evaluate;
    }

    @Override
    public void onBindViewHolder(BaseViewHolder baseViewHolder, int pos) {
        super.onBindViewHolder(baseViewHolder, pos);

    }

    @Override
    public void onBindHolder(BaseViewHolder<AdapterEvaluateBinding> holder, int pos) {
        Glide.with(mContext).load(mList.get(pos).getHead()).into(holder.getBinding().imageHead);
        holder.getBinding().setBase(mList.get(pos));
        BarterImageAdapter barterImageAdapter = new BarterImageAdapter(mContext);
        barterImageAdapter.setList(mList.get(pos).getImglist());
        holder.getBinding().mRecyclerViewRecommend.setAdapter(barterImageAdapter);
        holder.getBinding().mRecyclerViewRecommend.setLayoutManager(new FullyGridLayoutManager(mContext, 3) {
            @Override
            public boolean canScrollVertically() {
                return false;
            }
        });
    }

}
